<?php

// use Illuminate\Support\Facades\Schema;
use Jialeo\LaravelSchemaExtend\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InitCarriageTemplate extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('carriage_templates', function (Blueprint $table) {
            $table->comment = '运费模板表';
            
            $table->increments('id');
            $table->uuid('uuid')->index();

            $table->integer('shop_id')->unsigned()->nullable()->index();

            $table->string('name', 50)->comment('模板名称');

            $table->tinyInteger('type')->index()->default(0)->comment('0为按件数，  1为按重量'); // 0为按件数，  1为按重量

            $table->string('rules', 10000)->comment('规则细节');

            $table->softDeletes();
            $table->timestamps();
            
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::disableForeignKeyConstraints();
        Schema::dropIfExists('carriage_templates');
    }
}
